package com.booza.dao;

import java.util.Collection;

import com.booza.model.PlayerRankings;

/**
 * A DAO level interface for player rankings table.
 */
public interface PlayerRankingsDAO
{
	/**
	 * Find a row by PK in player rankings table.
	 * 
	 * @param id
	 */
	PlayerRankings findById(Integer id);

	/**
	 * Find all rankings for the given user.
	 * 
	 * @param userId
	 *          - user id
	 * @return matching rankings list
	 */
	Collection<PlayerRankings> findRankingsForUser(Integer userId);

	/**
	 * Finds the ranking row for the given user and for the given game type.
	 * 
	 * @param userId
	 * @param gameId
	 */
	Collection<PlayerRankings> findRankingsForUserForGame(Integer userId, Integer gameId);

	/**
	 * Inserts or updates player rankings.
	 * 
	 * @param row
	 */
	void saveRankings(PlayerRankings row);

	/**
	 * Updates multiple ranking entries.
	 * 
	 * @param rankings
	 */
	void saveRankings(Collection<PlayerRankings> rankings);
}
